package me.zhengjie.domain;

import lombok.Data;

@Data
public class CommonResult {

	private int code = 1;

	private String msg;

	private Object data;

	public CommonResult() {

	}

	public CommonResult(int code, String msg, Object data) {
		this.code = code;
		this.msg = msg;
		this.data = data;
	}

	public static CommonResult fail(String msg) {
		return new CommonResult(0, msg, null);
	}

	public static CommonResult ok(String msg) {
		return new CommonResult(1, msg, null);
	}


	public static CommonResult ok(String msg, Object data) {
		return new CommonResult(1, msg, data);
	}

}
